package com.pac.analysis.dao.impl;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.pac.analysis.bean.AbortionMonthF2Bean;
import com.pac.analysis.bean.OptionProportionBean;
import com.pac.analysis.bean.UserMonthBean;
import com.pac.analysis.dao.UserAnalysisDao;

/**
 * 患者分析
 * 
 * @author lujun.chen
 * @version [版本号, 2015年12月30日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Repository(value = "userAnalysisDao")
public class UserAnalysisDaoImpl implements UserAnalysisDao {

	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public List<UserMonthBean> countUserMonth(UserMonthBean userMonthBean) {

		return sqlSessionTemplate.selectList("countUserMonth", userMonthBean);
	}

	@Override
	public List<AbortionMonthF2Bean> countAbortionMonthF2(
			AbortionMonthF2Bean abortionMonthF2Bean) {
		return sqlSessionTemplate.selectList("countAbortionMonthF2",
				abortionMonthF2Bean);
	}

	@Override
	public List<OptionProportionBean> countAbortionReasonF2(
			OptionProportionBean optionProportionBean) {
		return sqlSessionTemplate.selectList("countAbortionReasonF2",
				optionProportionBean);
	}

	@Override
	public int countMonthFollow(OptionProportionBean optionProportionBean) {
		return sqlSessionTemplate.selectOne("countMonthFollow",
				optionProportionBean);
	}

	@Override
	public int abortionTotalNum(AbortionMonthF2Bean abortionMonthF2Bean) {
		return sqlSessionTemplate.selectOne("abortionTotalNum",
				abortionMonthF2Bean);
	}

	@Override
	public int abortionMonthNum(OptionProportionBean optionProportionBean) {
		return sqlSessionTemplate.selectOne("abortionMonthNum",
				optionProportionBean);
	}

}
